<HTML>
<HEAD>
  <TITLE> DwGroup Man Page </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>
  <FONT COLOR="navy"> NAME </FONT>
</H2>
<P>
DwGroup -- Class representing an RFC-822 address group
<H2>
  <FONT COLOR="navy"> SYNOPSIS </FONT>
</H2>
<PRE>class DW_EXPORT DwGroup : public <A HREF="address.html">DwAddress</A> {

public:

    <A HREF="group.html#DwGroup">DwGroup</A>();
    <A HREF="group.html#DwGroup">DwGroup</A>(const DwGroup&amp; aGroup);
    <A HREF="group.html#DwGroup">DwGroup</A>(const DwString&amp; aStr, DwMessageComponent* aParent=0);
    virtual ~DwGroup();
    const DwGroup&amp; <A HREF="group.html#op_eq">operator =</A> (const DwGroup&amp; aGroup);
    virtual void <A HREF="group.html#Parse">Parse</A>();
    virtual void <A HREF="group.html#Assemble">Assemble</A>();
    virtual DwMessageComponent* <A HREF="group.html#Clone">Clone</A>() const;
    const DwString&amp; <A HREF="group.html#GroupName">GroupName</A>() const;
    const DwString&amp; <A HREF="group.html#Phrase">Phrase</A>() const;
    void <A HREF="group.html#SetGroupName">SetGroupName</A>(const DwString&amp; aName);
    void <A HREF="group.html#SetPhrase">SetPhrase</A>(const DwString&amp; aPhrase);
    DwMailboxList&amp; <A HREF="group.html#MailboxList">MailboxList</A>() const;
    static DwGroup* <A HREF="group.html#NewGroup">NewGroup</A>(const DwString&amp; aStr,
        DwMessageComponent* aParent);
    static DwGroup* (*<A HREF="group.html#sNewGroup">sNewGroup</A>)(const DwString&amp;, DwMessageComponent*);

protected:

    DwMailboxList* <A HREF="group.html#mMailboxList">mMailboxList</A>;

public:

    virtual void <A HREF="group.html#PrintDebugInfo">PrintDebugInfo</A>(ostream&amp; aStrm, int aDepth=0) const;
    virtual void <A HREF="group.html#CheckInvariants">CheckInvariants</A>() const;

protected:

    void _PrintDebugInfo(ostream&amp; aStrm) const;
};
</PRE>
<H2>
  <FONT COLOR="navy"> DESCRIPTION </FONT>
</H2>
<P>
<B><TT>DwGroup</TT></B> represents a <I>group</I> as described in RFC-822.
A group contains a group name and a (possibly empty) list of
<I>mailboxes</I>. In MIME++, a <B><TT>DwGroup</TT></B> object contains a
string for the group name and a
<B><TT><A HREF="mboxlist.html">DwMailboxList</A></TT></B> object for the
list of mailboxes.
<P>
In the tree (broken-down) representation of message, a
<B><TT>DwGroup</TT></B> object may be only an intermediate node, having both
a parent and a single child node. Its parent node must be a
<B><TT><A HREF="field.html">DwField</A></TT></B> or a
<B><TT><A HREF="addrlist.html">DwAddressList</A></TT></B>. Its child is a
<B><TT>DwMailboxList</TT></B>.
<P>
A <B><TT>DwGroup</TT></B> is a
<B><TT><A HREF="address.html">DwAddress</A></TT></B>, and therefore it can
be included in a list of <B><TT>DwAddress</TT></B> objects. To get the next
<B><TT>DwAddress</TT></B> object in a list, use the inherited member function
<B><TT>DwAddress::Next()</TT></B>.
<H2>
  <FONT COLOR="navy"> Public Member Functions </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> <A NAME="DwGroup">DwGroup</A>() <BR>
DwGroup(const DwGroup&amp; aGroup) <BR>
DwGroup(const DwString&amp; aStr, DwMessageComponent* aParent=0) </B></FONT>
<P>
The first constructor is the default constructor, which sets the
<B><TT>DwGroup</TT></B> object's string representation to the empty string
and sets its parent to <B><TT>NULL</TT></B>.
<P>
The second constructor is the copy constructor, which performs a deep copy
of <B><TT>aGroup</TT></B>. The parent of the new <B><TT>DwGroup</TT></B>
object is set to <B><TT>NULL</TT></B>.
<P>
The third constructor copies <B><TT>aStr</TT></B> to the
<B><TT>DwGroup</TT></B> object's string representation and sets
<B><TT>aParent</TT></B> as its parent. The virtual member function
<B><TT>Parse()</TT></B> should be called immediately after this constructor
in order to parse the string representation. Unless it is
<B><TT>NULL</TT></B>, <B><TT>aParent</TT></B> should point to an object of
a class derived from <B><TT>DwField</TT></B> or
<B><TT>DwAddressList</TT></B>.
<P>
<FONT COLOR="teal"><B> const DwGroup&amp; <A NAME="op_eq">operator =</A>
(const DwGroup&amp; aGroup) </B></FONT>
<P>
This is the assignment operator, which performs a deep copy of
<B><TT>aGroup</TT></B>. The parent node of the <B><TT>DwGroup</TT></B> object
is not changed.
<P>
<FONT COLOR="teal"><B> virtual void <A NAME="Parse">Parse</A>() </B></FONT>
<P>
This virtual function, inherited from <B><TT>DwMessageComponent</TT></B>,
executes the parse method for <B><TT>DwGroup</TT></B> objects. The parse
method creates or updates the broken-down representation from the string
representation. For <B><TT>DwGroup</TT></B> objects, the parse method parses
the string representation to extract the group name and to create a
<B><TT>DwMailboxList</TT></B> object from the list of mailboxes. This member
function also calls the <B><TT>Parse()</TT></B> member function of the
<B><TT>DwMailboxList</TT></B> object it creates.
<P>
You should call this member function after you set or modify the string
representation, and before you access the group name or the mailbox list.
<P>
This function clears the is-modified flag.
<P>
<FONT COLOR="teal"><B> virtual void <A NAME="Assemble">Assemble</A>()
</B></FONT>
<P>
This virtual function, inherited from <B><TT>DwMessageComponent</TT></B>,
executes the assemble method for <B><TT>DwGroup</TT></B> objects. The assemble
method creates or updates the string representation from the broken-down
representation. That is, the assemble method builds the string representation
from its group name and mailbox list. Before it builds the string representation,
this function calls the <B><TT>Assemble()</TT></B> member function of its
contained <B><TT>DwMailboxList</TT></B> object.
<P>
You should call this member function after you set or modify either the group
name or the contained <B><TT>DwMailboxList</TT></B> object, and before you
retrieve the string representation.
<P>
This function clears the is-modified flag.
<P>
<FONT COLOR="teal"><B> virtual DwMessageComponent*
<A NAME="Clone">Clone</A>() const </B></FONT>
<P>
This virtual function, inherited from <B><TT>DwMessageComponent</TT></B>,
creates a new <B><TT>DwGroup</TT></B> on the free store that has the same
value as this <B><TT>DwGroup</TT></B> object. The basic idea is that of a
virtual copy constructor.
<P>
<FONT COLOR="teal"><B> const DwString&amp;
<A NAME="GroupName">GroupName</A>() const </B></FONT>
<P>
Returns the name of the group.
<P>
<FONT COLOR="teal"><B> const DwString&amp; <A NAME="Phrase">Phrase</A>()
const </B></FONT>
<P>
Returns the name of the phrase part of a group as described in RFC-822. The
phrase is the same as the group name.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetGroupName">SetGroupName</A>(const
DwString&amp; aName) </B></FONT>
<P>
Sets the name of the group.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetPhrase">SetPhrase</A>(const
DwString&amp; aPhrase) </B></FONT>
<P>
Sets the name of the phrase part of a group as described in RFC-822. The
phrase is the same as the group name.
<P>
<FONT COLOR="teal"><B> Dw<A NAME="MailboxList">MailboxList</A>&amp; MailboxList()
const </B></FONT>
<P>
Provides access to the list of mailboxes that is part of a group as described
in RFC-822.
<P>
<FONT COLOR="teal"><B> static DwGroup* <A NAME="NewGroup">NewGroup</A>(const
DwString&amp; aStr, DwMessageComponent* aParent) </B></FONT>
<P>
Creates a new <B><TT>DwGroup</TT></B> object on the free store. If the static
data member <B><TT>sNewGroup</TT></B> is <B><TT>NULL</TT></B>, this member
function will create a new <B><TT>DwGroup</TT></B> and return it. Otherwise,
<B><TT>NewGroup()</TT></B> will call the user-supplied function pointed to
by <B><TT>sNewGroup</TT></B>, which is assumed to return an object from a
class derived from <B><TT>DwGroup</TT></B>, and return that object.
<P>
<FONT COLOR="teal"><B> virtual void
<A NAME="PrintDebugInfo">PrintDebugInfo</A>(ostream&amp; aStrm, int aDepth=0)
const </B></FONT>
<P>
This virtual function, inherited from <B><TT>DwMessageComponent</TT></B>,
prints debugging information about this object to <B><TT>aStrm</TT></B>.
It will also call <B><TT>PrintDebugInfo()</TT></B> for any of its child
components down to a level of <B><TT>aDepth</TT></B>.
<P>
This member function is available only in the debug version of the library.
<P>
<FONT COLOR="teal"><B> virtual void
<A NAME="CheckInvariants">CheckInvariants</A>() const </B></FONT>
<P>
Aborts if one of the invariants of the object fails. Use this member function
to track down bugs.
<P>
This member function is available only in the debug version of the library.
<H2>
  <FONT COLOR="navy"> Public Data Members </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> static DwGroup*
(*<A NAME="sNewGroup">sNewGroup</A>)(const DwString&amp;, DwMessageComponent*)
</B></FONT>
<P>
If <B><TT>sNewGroup</TT></B> is not <B><TT>NULL</TT></B>, it is assumed to
point to a user-supplied function that returns an object from a class derived
from <B><TT>DwGroup</TT></B>.
<H2>
  <FONT COLOR="navy"> Protected Data Members </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> DwMailboxList* <A NAME="mMailboxList">mMailboxList</A>
</B></FONT>
<P>
Points to the <B><TT>DwMailboxList</TT></B> object.
<P>
</BODY></HTML>
